home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of NeuroSolutions BackBiasAxon component
-
- #include "NSDLL.h"
-
- /********************************/
- /* Backpropagation of component */
-
- __declspec(dllexport) void performBackBiasAxon(
- DLLData *instance, // Pointer to instance data (may be NULL)
- DLLData *dualInstance, // Pointer to the forward axons instance data (may be NULL)
- NSFloat *data, // Pointer to the layer of processing elements (PEs)
- int rows, // Number of rows of PEs in the layer
- int cols, // Number of columns of PEs in the layer
- NSFloat *error, // Pointer to the sensitivity vector
- NSFloat *gradient // Pointer to the bias gradient vector
- )
-
- {
- int i, length=rows*cols;
-
- if (gradient)
- for (i=0; i<length; i++)
- gradient[i] += error[i];
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocBackBiasAxon(
- DLLData *oldInstance, // Pointer to the last instance if reallocating
- DLLData *dualInstance, // Pointer to forward axonÆs instance data (may be NULL)
- int rows, // Number of rows of PEs in the layer
- int cols // Number of columns of PEs in the layer
- )
- {
- DLLData *instance = allocDLLInstance(oldInstance);
- return instance;
- }
-
- __declspec(dllexport) void freeBackBiasAxon(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */